<template>
	<view class="">
		<image class="image" src="@/static/mine/qa/question.png" mode="aspectFill"></image>
		<view class="content" v-for="(item, index) in list" :key="index">
			<view class="title flex">
				<image class="icon" src="@/static/mine/qa/qa-icon.png" mode="aspectFill"></image>
				<text class="text">{{ item.typeName }}</text>
			</view>
			<u-collapse accordion>
				<u-collapse-item :title="item1.question" v-for="(item1, index1) in item.faqList" :key="index1">
					<text class="u-collapse-content">{{ item1.answer }}</text>
				</u-collapse-item>
			</u-collapse>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		onLoad() {
			this.initList();
		},
		methods: {
			initList() {
				this.$http_api.faqList({ languageCode: 'zh_CN' }).then(res => {
					this.list = res;
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.image {
		width: 100vw;
		height: 230rpx;
	}

	.content {
		background: #fff;
		border-top-left-radius: 20rpx;
		border-top-right-radius: 20rpx;
		margin-top: -30rpx;
		position: relative;
		padding: 30rpx;

		.title {
			height: 80rpx;

			.icon {
				width: 32rpx;
				height: 32rpx;
				margin-right: 20rpx;
			}

			.text {
				font-weight: 600;
				font-size: 32rpx;
				color: #000000;
				font-family: "PINGFANG";
			}
		}
	}
	
	.u-collapse-title {
		font-weight: 400;
		font-size: 32rpx;
		color: #000;
		font-family: "PINGFANG";
		line-height: 45rpx;
	}
	
	.u-collapse-content {
		font-weight: 400;
		font-size: 28rpx;
		color: #333;
		font-family: "PINGFANG";
		line-height: 45rpx;
	}
</style>